<div class="bjui-pageContent">
    <form action="/admin/administration/policy/notice-policy-add" data-toggle="ajaxform"
          data-options="{closeCurrent: true, okAfterCallback: freshPostPersonnel}">
        <div class="bjui-row col-2">


            <label class="row-label">标题</label>
            <div class="row-input">
                <input type="text" class="input-sm" value="" data-rule="required;" name="title">
            </div><br/>

            <label class="row-label">类型</label>
            <div class="row-input">
                <select data-toggle="selectpicker" onchange="selectOnclick(this.value)" name="type">
                    <option value="1">新闻</option>
                    <option value="2">政策</option>
                </select>
            </div><br/>


            <label class="row-label">上传封面图</label>
            <div class="row-input required" style="width:240px">
                <input type="file" data-name="main_image_url" data-toggle="webuploader" data-options="
                {
                    pick: {label: '点击选择图片'},
                    server: '/admin/administration/policy/notice-policy-img-upload',
                    fileNumLimit: 1,
                    formData: {_token:'{{csrf_token()}}'},
                    required: true,
                    uploaded: '',
                    basePath: '',
                    accept: {
                        title: '图片',
                        extensions: 'jpg,png',
                        mimeTypes: '.jpg,.png'
                    }
                }">
                <span   id="shangchuan">请上传宽高比约为1:0.4的图片，避免比例失调</span>
            </div><br/>

            <div id="public_module_content">
                <label class="row-label">内容</label>
                <div class="row-input " style="width:720px">
                    <textarea name="content" style="width: 700px;" data-toggle="kindeditor"
                              data-items=" 'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste','plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright','justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript','superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '|','formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold','italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage','flash', 'media', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak','anchor', 'link', 'unlink', '|','about'">
                    </textarea>
                </div>
            </div><br/>

        </div>
    </form>
</div>
<div class="bjui-pageFooter">
    <ul>
        <li>
            <button type="button" class="btn-close" data-icon="close">取消</button>
        </li>
        <li>
            <button type="submit" class="btn-default" data-icon="save">保存</button>
        </li>
    </ul>
</div>
<script>
    function freshPostPersonnel() {
        $("#notice-policy-list").datagrid("refresh", true);
    }

    function selectOnclick(selectedtype) {
        if(selectedtype==1){
            $("#shangchuan").empty().append("请上传宽高比约为1:0.4的图片，避免比例失调")
        }else if(selectedtype==2){
            $("#shangchuan").empty().append("请上传宽高比约为1:1的图片，避免比例失调")
        }
    }
</script>
